{extend name="base" /}
{block name="css"}
<link rel="stylesheet" href="__PUBLIC__/css/form.css">
{/block}
{block name="body"}
<div class="admin-main layui-form layui-field-box">
    <blockquote class="layui-elem-quote layui-text">
        排序规则：数值0排序最前面，数字越大越靠后
    </blockquote>

    <div class="layui-field-box">
        <button class="layui-btn" data-url="{:url('admin/paid/video_alldelete')}"  lay-submit lay-filter="alldelete">删除选中</button>
        <a href="{:url('admin/paid/video_add')}" class="layui-btn" id="add">
            添加
        </a>
        <form style="float:right;" action="{:url('admin/paid/video_list')}" method="get"  >
            <div class="layui-inline">
                <div class="layui-input-inline">
                    <input type="text" name="keyword" value="{:session('keyword')}" placeholder="请输入关键词" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <button class="layui-btn">搜索</button>
            </div>
        </form>
    </div>

    <table class="layui-table admin-table">
        <thead>
            <tr>
                <th width="5%" align="center">
                    <input type="checkbox" name="checkAll" lay-filter="checkAll">
                </th>
                <th>图片</th>
                <th>课程</th>
                <th style="width:20%;">标题</th>
                <th>积分</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
            {volist name="list" id="vo"}
            <tr>
                <td align="center">
                    <input type="checkbox" name="delid[]" lay-filter="checkOne" value="{$vo.id}">
                </td>
                <td>
                    <img style="width:96px;height:54px;max-width:96px;" onerror="this.src='/image/study_default.png'" src="{:config('web.QINIU')}{$vo.vimg}" alt="">
                </td>
                <td>
                    {php}
                        echo db('video_type')->where(['id'=>$vo['tid']])->value('typename');
                        echo '<br/>';
                        echo '&nbsp;&nbsp;&nbsp;&nbsp;|--';
                        echo db('video_type')->where(['id'=>$vo['cid']])->value('typename');
                    {/php}
                </td>
                <td style="width:20%;word-break:break-all;">{$vo.vname} </td>
                <td>{$vo.integral}</td>
                <td>
                    <a href="{:url('admin/paid/video_edit',['id'=>$vo['id']])}" class="layui-btn layui-btn-normal layui-btn-xs">编辑</a>
                    <a href="javascript:;" data-id="{$vo.id}" data-url="{:url('admin/paid/video_delete',array('id'=>$vo['id']))}" data-opt="del"  class="elementdel layui-btn layui-btn-danger layui-btn-xs ajax-delete">删除</a>
                </td>
            </tr>
            {/volist}
        </tbody>
    </table>
</div>
{/block}

{block name="page"}
    <div class="btable-paged" >
    <div class="layui-main">
        {$list->render()|raw}
    </div>
</div>
{/block}
{block name="js"}
<script type="text/javascript" src="__PUBLIC__/js/delelement.js"></script>
{/block}